<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mall/Mebcardtype.js此处编写
 -->
<template>
  <div>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
      :editFormFileds="editFormFields" :editFormOptions="editFormOptions"
      :searchFormFields="searchFormFields" :searchFormFileds="searchFormFields"
      :searchFormOptions="searchFormOptions" :table="table" :extend="extend">
    </view-grid>
  </div>
</template>

<script>
import extend from "@/extension/mall/Mebcardtype.js";
import ViewGrid from "@/components/basic/ViewGrid.vue";
var vueParam = {
  components: {
    ViewGrid,
  },
  data() {
    return {
      table: {
        key: "cardtypeid",
        footer: "Foots",
        cnName: "卡模板",
        name: "Mebcardtype",
        url: "/Mebcardtype/",
        sortName: "createDate",
      },
      extend: extend,
      editFormFields: {
        pic: [],
        cardtypeCode: "",
        cardtypename: "",
        is_quota: "",
        creator: "",
        createDate: "",
        description: "",
        basetype: "",
        quota: "",
        is_discount: "",
        is_realname: "",
        discount_id: "",
        supplierCode: "",
        pointsCode: "",
        distributorAppids: [],
        online_usable: '',
        isvalueCard:"",
        isMessage: '',
        IsBrushFace: 0,
        KFphone: ''
      },
      editFormOptions: [
        [
          {
            field: "cardtypename",
            title: "卡模板名称",
            type: "text",
            required: true,
          },
          {
            field: "basetype",
            title: "卡类型",
            type: "select",
            required: true,
            dataKey: "Card_Type",
            data: [],
          },
          {
            field: "cardtypeCode",
            title: "卡模板代码",
            type: "text",
            required: true,
          },
        ],
        [
          { field: 'isvalueCard',title: '储值卡充值', type: 'switch', hidden: false },
          {field: "is_quota", title: "是否定额", type: "switch", hidden: false},
          { field: "quota", title: "卡面额", type: "text", hidden: false },
        ],
        [ { field: "is_discount",title: "是否打折", type: "switch", hidden: true }],
        [
          { field: "pic", maxSize: 1, title: "卡面图", type: "imgupgrade" },
          {
            field: "discount_id",
            title: "优惠方案",
            type: "select",
            dataKey: "preferential",
          },
          { field: "is_realname", title: "是否记名", type: "switch" },
          //  { "title": "供应商", "required": true, "field": "supplierid", "type": "select", "dataKey": "mall_supplier", colSize: 4,},
        ],
        [
          {
            title: "供应商",
            field: "supplierCode",
            colSize: 12,
            type: "selectList",
            dataKey: "mall_supplier",
            data: [],
            colSize: 6,
          },
          {
            title: "点位信息",
            field: "pointsCode",
            colSize: 12,
            type: "selectList",
            dataKey: "",
            hidden: true,
            data: [],
            colSize: 6,
          },
        ],
        [
          {
            title: "直营分销",
            field: "distributorAppids",
            colSize: 12,
            type: "selectList",
            dataKey: "distributorApplet",
            data: [],
            colSize: 6,
            required: true,
          },
          {
            title: "线上是否可用",
            field: "online_usable",
            type: "radio",
            data: [
              { key: 0, value: "不可用" },
              { key: 1, value: "可用" },
            ],
            required: true,
            colSize: 6,
          },
        ],
        [

          { title: '是否刷脸', field: 'IsBrushFace', type: 'switch', hidden: false, colSize: 6 },
          { title: '是否发送短信', field: 'isMessage', type: 'switch', hidden: false, colSize: 6 },
        ],
        [
          { dataKey: 'Signs', data: [], title: '短信签名', field: 'signCode', type: 'select', hidden: false, colSize: 6 },
          { dataKey: 'Messages', data: [], title: '短信模板', field: 'smsName', type: 'select', hidden: false, colSize: 6 },
        ],
        [{ title: '模板内容', field: 'smsNote', type: 'text', hidden: false, disabled: true, colSize: 12 }],
        [
          {
            field: "description",
            title: "卡模板描述",
            type: "textarea",
            colSize: 12,
          },
        ],
        [{ title: '客服电话', field: 'KFphone', type: 'text', required: true}],
      ],
      searchFormFields: { cardtypename: "", basetype: "" },
      searchFormOptions: [
        [
          { field: "cardtypename", title: "卡模板名称", type: "like" },
          {
            field: "basetype",
            title: "卡类型",
            type: "select",
            dataKey: "Card_Type",
          },
        ],
      ],
      columns: [
        {
          field: "cardtypename",
          title: "卡模板名称",
          type: "string",
          width: 120,
          align: "left",
        },
        {
          field: "cardtypeCode",
          title: "卡模板代码",
          type: "string",
          width: 120,
          align: "left",
        },
        {
          field: "basetype",
          title: "卡类型",
          type: "string",
          width: 80,
          align: "left",
          bind: { key: "Card_Type", data: [] },
        },
        {
          field: "quota",
          title: "卡面额",
          type: "string",
          width: 80,
          align: "left",
        },
        {
          field: "is_quota",
          title: "是否定额",
          type: "int",
          bind: {
            key: "",
            data: [
              { key: false, value: "否" },
              { key: true, value: "是" },
            ],
          },
          width: 80,
          align: "left",
        },
        {
          field: "is_discount",
          title: "是否打折",
          type: "int",
          bind: {
            key: "",
            data: [
              { key: false, value: "否" },
              { key: true, value: "是" },
            ],
          },
          width: 80,
          align: "left",
        },
        {
          field: "is_realname",
          title: "是否记名",
          type: "int",
          bind: {
            key: "",
            data: [
              { key: false, value: "否" },
              { key: true, value: "是" },
            ],
          },
          width: 80,
          align: "left",
        },
        {
          title: "线上是否可用",
          field: "online_usable",
          type: "int",
          bind: {
            key: "",
            data: [
              { key: 0, value: "不可用" },
              { key: 1, value: "可用" },
            ],
          },
          width: 100,
        },
        {
          title: "是否刷脸",
          field: "IsBrushFace",
          type: "int",
          bind: {
            key: "",
            data: [
              { key: 0, value: "否" },
              { key: 1, value: "是" },
            ],
          },
          width: 100,
        },
        {
          field: "description",
          title: "描述",
          type: "string",
          width: 120,
          align: "left",
        },
        {
          field: "creator",
          title: "创建人",
          type: "string",
          width: 120,
          align: "left",
        },
        {
          field: "createDate",
          title: "创建时间",
          type: "datetime",
          width: 120,
          align: "left",
        },
      ],
      detail: {
        cnName: "#detailCnName",
        columns: [],
        sortName: "",
        key: "",
      },
    };
  },
};
export default vueParam;
</script>
